PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

If (Simple Statement)

A simple If statement contains one Boolean expression and a statement to be executed if the value of the Boolean expression is true .

SYNTAX
if Boolean then statement

where

Boolean is an expression whose value is true or false .

statement is any AppleScript statement.

EXAMPLES

In the following If statement, the Display Dialog command is executed only if the value of the Boolean expression result > 3 is true .

if result > 3 then display dialog "The result is " & result as string

© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)